# -*- coding:utf-8 -*-

class Person(object):
    def __init__(self,name,age):
        self.name = name
        if isinstance(age,int):
            self.age = age
        else:
            return Exception('age must be int')

    def __eq__(self, other):
        if isinstance(other,Person):
            if self.age == other.age:
                return True
            else:
                return False
        else:
            return Exception('must be Person')

    def __add__(self, other):
        if isinstance(other,Person):
            return other.age+self.age
        else:
            return Exception('must be Person')



if __name__=="__main__":
    person1 = Person('张三',21)
    person2 = Person('李四',21)
    print person1 == person2
    print person1+person2